package com.gy.componit;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * @author Dsy
 * @create 2022-02-04  3:06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AreaPoint {

    private int x,y;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AreaPoint areaPoint = (AreaPoint) o;
        return x == areaPoint.x &&
                y == areaPoint.y;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }

    public AreaPoint reset(int x, int y) {
        this.x = x;
        this.y = y;
        return this;
    }
}
